<?
class Service_Webdesign_Detail extends Common{
    var $table = 'service_webdesign';
    var $id_field = 'ser_id';
    var $name_field = 'ser_title';
    var $result = array();
    public function __construct($id = 0){
        parent::__construct($id);
        $this->result = db_first('SELECT ser_id,ser_title,ser_summary,ser_picture,ser_detail
                                  FROM '.$this->table.'
                                  WHERE ser_active = 1 AND '.$this->id_field.' = "'.$this->id.'"
                                  LIMIT 1');
        $this->name = $this->result['ser_title'];
        $this->description = $this->result['ser_summary'];
        $this->url = DOMAIN.generate_service_webdesign_detail_url($this->result);
        $this->picture = DOMAIN.page_img.$this->result['ser_picture'];
    }
    
    public function relate() {
        $query = new db_query('SELECT ser_id,ser_title,ser_summary,ser_picture,ser_detail
                                  FROM '.$this->table.'
                                  WHERE ser_active = 1 AND '.$this->id_field.' != "'.$this->id.'"
                                  LIMIT 10');
        $result = $query->resultArray();unset($query);
        return $result;
    }
}
?>